home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
libs
/
knowhow4
/
cursor.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-10-10
|
708b
|
31 lines
// CURSOR.H
#ifndef __CURSOR_H_ // Draws and hides (draws with reverse color)
#define __CURSOR_H_ // symbol '_' under current position
#include <graphics.h>
#include <alloc.h>
class Cursor
{
protected:
int cx, cy;
public:
Cursor() { cx = cy = 0; }
void show_cursor()
{
int i_size = imagesize(0, 0, 3, textheight("M") + 1);
void* image = (void*)malloc(i_size);
getimage(cx, cy - textheight("M"), cx, cy, image);
putimage(cx, cy - textheight("M"), image, NOT_PUT);
delete image;
}
void hide_cursor() { show_cursor(); }
void set_cursor(int x, int y)
{
::moveto(cx = x, cy = y);
}
};
#endif __CURSOR_H_